package com.dong.datachangecontrol.demo.dao;

import com.dong.datachangecontrol.demo.entity.Person;
import org.apache.ibatis.annotations.*;

import java.util.List;

public interface PersonDao {
    @Select("select * from person")
    List<Person> getPersonList();
    @Update({"update person set name = #{person.name},set age = #{person.age},set address = #{person.address},set birthday=#{person.birthday} where id = #{person.id}"})
    Person updatePerson(@Param("person") Person person);
    @Delete("delete from person where id = #{id}")
    Person deleteById(Integer id);
    @Insert("insert into person values(#{name},#{age},#{address},#{birthday})")
    Person addPerson(Person person);
    @Select("select * from person where id = #{id}")
    Person getById(Integer id);
}
